import { createPinia } from 'pinia'
import './style.css'
import App from './App.vue'
import router from './routes'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import axios from 'axios'
axios.defaults.baseURL='http://localhost:5173/'


import { createApp } from 'vue'
import { createStore } from 'vuex'

// 创建一个新的store实例
const store = createStore({
  state () {
    return {
      count: 0
    }
  },
  mutations: {
    addState (state) {
      state.count = 1;
    },
    minusState(state){
      state.count = 0;
    }
  }
})


const app = createApp(App)
app.use(router)
app.use(store)
app.mount('#app')
app.use(createPinia())
app.config.globalProperties.$axios = axios

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
  }
